<%@ page language="java" pageEncoding="utf-8"%>
<%@ include file="/WEB-INF/jsp/pub/include.jsp" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title>用户操作记录</title>
    <link href="<%=request.getContextPath() %>/css/admin.css" rel="stylesheet" type="text/css" />
    <script type="text/javascript" src="<%=request.getContextPath()%>/js/common.js"></script>
    <script type="text/javascript" src="<%=request.getContextPath()%>/js/jquery.js"></script>
    <script type="text/javascript" src="<%=request.getContextPath()%>/js/jquery.form.js"></script>
    <script type="text/javascript">

        function show(id){
            var msg = "您真的确定要删除吗？\n\n请确认！";
            if (confirm(msg)==true){
             var  url=getRootPath()+"/admin/deluser?m=del&id="+id;
              $.ajax({
                type:"GET",
                url: url,
                success:function(returndata){
                    var rdata = JSON.parse(returndata);
                    alert(rdata.data.message);
                    if(rdata.data.suc){
                        window.location.href= getRootPath()+"/admin/usermanage?m=list";
                    }else{
                        alert(rdata.data.message);
                    }
                }
            });
            }
        }
        function del(id){

          location=getRootPath()+"/admin/deluser?m=del&id="+id;
//            $.ajax({
//                cache:false,
//                type:"GET",
//                url: url,
//                error:function(XMLHttpRequest, textStatus, errorThrown) {
//                    alert(XMLHttpRequest.status);
//                },
//                success:function(returndata){
//                    if(returndata.data.suc){
//                        window.location.href= getRootPath()+"/admin/index";
//                    }else{
//                        alert(returndata.data.message);
//                    }
//                }
//            });
        }
        function search(){

            var key = $("#key").val();
            var url = "<c:url value="/admin/usermanage?m=list"/>";
            if(key!=""){
                url+="&key="+key;
            }

            location=url;
        }
        function addproject(){

            var url = "<c:url value="/user/usermanage?m=add"/>";
            location=url;
        }


        function changeselect(){
            var url='<c:url value="/user/userlog?m=list"/>';

            if($("#userid").val()!=""){
                url+='&userid='+$("#userid").val();
            }
            location=url;
        }
    </script>
</head>
<body>
<div class="content">
    <jsp:include page="../pub/top.jsp"></jsp:include>
    <!--头部结束-->
    <table width="100%" border="0" cellspacing="0" cellpadding="0">
        <tr>
            <td class="left" valign="top">
                <jsp:include page="../pub/left_user.jsp"></jsp:include>
            </td>
            <td valign="top">
                <div id="c01">
                    <dl>
                    <c:if test="${sessionScope.user.permission.code=='1'}">
                        <dt style="padding-right:30px;">用户选择：
                            <select class="sheng" name="userid" id="userid"  onchange="changeselect()">
                                <option value="0">全部</option>
                                <c:forEach items="${userList}" var="user">
                                    <option value="${user.id}" ${user.id ==param.userid?'selected=selected':''}><c:out value="${user.username}"/></option>
                                </c:forEach>
                            </select>
                        </dt>
                     </c:if>
                    </dl>
                    <table width="99%" border="0" cellpadding="0" cellspacing="1" bgcolor="#dae2e5">
                        <tr>
                            <td width="5%" height="30" bgcolor="#e5edfa" align="center">序号</td>
                            <td width="10%" height="30" bgcolor="#e5edfa" align="center" >名字</td>
                            <td width="10%" height="30" bgcolor="#e5edfa" align="center">时间</td>
                            <td width="10%" height="30" bgcolor="#e5edfa" align="center">记录</td>
                            <td width="20%" height="30" bgcolor="#e5edfa" align="center" >记录项</td>
                        </tr>
                        <c:choose>
                            <c:when test="${not empty logList}">
                                <c:forEach items="${logList}" var="log" varStatus="vs">
                                    <tr>
                                        <td height="30" bgcolor="#FFFFFF" align="center">
                                            <input type="hidden" name="id" value="${log.id}"/>
                                            <c:out value="${vs.index+1}"/></td>
                                        <td height="30" bgcolor="#FFFFFF" align="center" style="color: #cc0000">
                                                <c:out value="${log.user.username}"/>
                                        </td>
                                        <td height="30" bgcolor="#FFFFFF" align="center" style="padding-left:10px;">

                                            <c:out value="${log.optime}"/>
                                                <%--<a href="<c:url value="/clazz/view.do?id=${clazz.id}"/>" target="_blank"><c:out value="${clazz.name}"/></a>--%>
                                        </td>
                                        <td height="30" bgcolor="#FFFFFF" align="center" style="padding-left:10px;">
                                            <c:out value="${log.operate}"/>
                                                <%--<a href="<c:url value="/clazz/view.do?id=${clazz.id}"/>" target="_blank"><c:out value="${clazz.name}"/></a>--%>
                                        </td>
                                        <td height="30" bgcolor="#FFFFFF" align="center" style="padding-left:10px;">
                                            <%--<c:out value="${log.info}"/>--%>
                                                <%--<a href="<c:url value="/clazz/view.do?id=${clazz.id}"/>" target="_blank"><c:out value="${clazz.name}"/></a>--%>
                                        </td>
                                    </tr>
                                </c:forEach>
                            </c:when>
                            <c:otherwise>
                                <tr>
                                    <td colspan="8" height="30" bgcolor="#ffffff" align="center">暂无数据</td>
                                </tr>
                            </c:otherwise>
                        </c:choose>
                    </table>
                    <jsp:include page="/WEB-INF/jsp/pub/page.jsp"></jsp:include>
                    <%--<p><input type="checkbox" onclick="selectAll(this)"/> 全选 --%>
                    <%--<input type="button" value="删除" class="shanchu" onclick="del(0)"/></p>--%>
                    <%--<jsp:include page="/WEB-INF/jsp/pub/page.jsp"></jsp:include>--%>
                </div>
                <br />
                <br />
            </td>
        </tr>
    </table>
    <jsp:include page="../pub/foot.jsp"></jsp:include>
</div>
</body>
</html>
